# coding: utf-8
import allure
from src.constans import *


@allure.step("登陆接口")
def login(mobile, password, env_url=None):
    """
    调用登陆接口
    :param mobile: 手机号
    :param password: 密码
    :param env_url: 访问地址
    """
    _url: str = f"/test/user/login?"
    if env_url:
        url: str = env_url + _url
    else:
        url: str = app_cof.BASE_URL + _url
    data: dict = {
        "mobile": mobile,
        "password": password
    }
    headers: dict = {
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
    }
    login_res = apb.required('post', url=url, data=data, headers=headers)
    return login_res


def module_request():
    ...
